import Layout from "@/layout";
// 需要后端（这里是moke数据）传过来的数据刚好是权限的分布（需要设置moke）

/** 
 * 销售模块路由配置
 * 路径: /sales
 * 包含功能: 销售订单、价格列表、订单导入、促销政策等
 */
export default {
    path: "/sales", // 基础路径
    component: Layout, // 使用布局组件
    redirect: "/sales/salesOrders", // 默认重定向到销售订单页
    alwaysShow: true, // 始终显示根菜单(即使只有一个子菜单)
    name: "sales", // 路由名称
    meta: {
        title: "销售管理", // 菜单显示名称
        icon: "shopping" // 菜单图标(根据你的图标库调整)
    },
    children: [
        // 订单导入
        {
            path: "/sales/orderImport",
            component: () => import("@/views/sales/orderImport.vue"),
            name: "orderImport",
            meta: { 
                title: "订单导入", 
                icon: "personnel" 
            }
        },
        // 销售订单管理
        {
            path: "/sales/salesOrders",
            component: () => import("@/views/sales/salesOrders.vue"),
            name: "salesOrders",
            meta: { 
                title: "销售订单", 
                icon: "personnel" 
            }
        },
        // 销售价格列表
        {
            path: "/sales/salesPriceList",
            component: () => import("@/views/sales/salesPriceList.vue"),
            name: "salesPriceList",
            meta: { 
                title: "销售价目表", 
                icon: "personnel" 
            }
        },
        // 佣金表格
        {
            path: "/sales/commissionTable",
            component: () => import("@/views/sales/commissionTable.vue"),
            name: "commissionTable",
            meta: { 
                title: "佣金表", 
                icon: "personnel" 
            }
        },
        // 促销政策发布
        {
            path: "/sales/promotionPolicyRelease",
            component: () => import("@/views/sales/promotionPolicyRelease.vue"),
            name: "promotionPolicyRelease",
            meta: { 
                title: "促销政策发布", 
                icon: "personnel" 
            }
        },
        // 滞销品规则
        {
            path: "/sales/rulesForSlowMovinggoods",
            component: () => import("@/views/sales/rulesForSlowMovinggoods.vue"),
            name: "rulesForSlowMovinggoods",
            meta: { 
                title: "滞销品规则", 
                icon: "personnel" 
            }
        },
        // 佣金计算
        {
            path: "/sales/commissionCalculations",
            component: () => import("@/views/sales/commissionCalculations.vue"),
            name: "commissionCalculations",
            meta: { 
                title: "佣金计算", 
                icon: "personnel" 
            }
        },
        
        // 逾期催收查询
        {
            path: "/sales/overdueCollectionInquiry",
            component: () => import("@/views/sales/overdueCollectionInquiry.vue"),
            name: "overdueCollectionInquiry",
            meta: { 
                title: "逾期收款查询", 
                icon: "personnel" 
            }
        },
        // 添加商品(隐藏菜单，仅通过其他页面跳转)
        {
            path: "/sales/addFlower",
            component: () => import("@/views/sales/addFlower.vue"),
            name: "addFlower",
            meta: { 
                title: "添加商品", 
                icon: "personnel",
                hidden: true // 不在侧边栏显示
            }
        }
    ]
};